const {Service} = require('egg');

class NewsService extends Service{
  // eggjs里内置了一个方法，用来读取远程接口数据
  async fetch(){
    // {data, headers} data是buffer
    let {data} = await this.ctx.curl('https://www.baidu.com');
    data = data.toString()
    let news = []

    data.replace()
  }
}

module.exports = NewsService;